import { observe } from '@violentmonkey/dom'

export const indexRender = () => {
  observe(document.body, () => {
    const $btn = $('.layui-layer-dialog .layui-layer-btn0')
    if ($btn.length) {
      setTimeout(
        () => {
          $('.layui-layer-dialog .layui-layer-btn0').trigger('click')
          setTimeout(
            () => {
              $('#mainContent')[0]?.contentWindow?.postMessage('play')
            }, 2000
          )

        }
        , 1000)
    }
  })

}
